package com.makerjia.magpiebridge.service.impl;

import com.makerjia.magpiebridge.dal.mapper.model.TestDO;
import com.makerjia.magpiebridge.dal.repository.TestRepository;
import com.makerjia.magpiebridge.service.TestService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Optional;

/**
 * @author caohw
 * @date 2020/6/9
 */
@Service
public class TestServiceImpl implements TestService {

    @Resource
    private TestRepository testRepository;

    /**
     * test
     * @return
     */
    @Override
    public String testValue() {
        Optional<TestDO> testDO = testRepository.testDao();
        if (!testDO.isPresent()) {
            return "Have no data";
        }
        return testDO.get().getResult();
    }
}
